home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / QDOffscreen.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  10.5 KB  |  426 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QDOffscreen.a
  3. ;
  4. ;    Contains:    Quickdraw Offscreen GWorld Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__QDOFFSCREEN__') = 'UNDEFINED' THEN
  19. __QDOFFSCREEN__ SET 1
  20.  
  21.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  22.     include 'Errors.a'
  23.     ENDIF
  24.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  25.     include 'Quickdraw.a'
  26.     ENDIF
  27.  
  28.  
  29. pixPurgeBit                        EQU        0
  30. noNewDeviceBit                    EQU        1
  31. useTempMemBit                    EQU        2
  32. keepLocalBit                    EQU        3
  33. pixelsPurgeableBit                EQU        6
  34. pixelsLockedBit                    EQU        7
  35. mapPixBit                        EQU        16
  36. newDepthBit                        EQU        17
  37. alignPixBit                        EQU        18
  38. newRowBytesBit                    EQU        19
  39. reallocPixBit                    EQU        20
  40. clipPixBit                        EQU        28
  41. stretchPixBit                    EQU        29
  42. ditherPixBit                    EQU        30
  43. gwFlagErrBit                    EQU        31
  44.  
  45. pixPurge                        EQU        $00000001
  46. noNewDevice                        EQU        $00000002
  47. useTempMem                        EQU        $00000004
  48. keepLocal                        EQU        $00000008
  49. pixelsPurgeable                    EQU        $00000040
  50. pixelsLocked                    EQU        $00000080
  51. kAllocDirectDrawSurface            EQU        $00004000
  52. mapPix                            EQU        $00010000
  53. newDepth                        EQU        $00020000
  54. alignPix                        EQU        $00040000
  55. newRowBytes                        EQU        $00080000
  56. reallocPix                        EQU        $00100000
  57. clipPix                            EQU        $10000000
  58. stretchPix                        EQU        $20000000
  59. ditherPix                        EQU        $40000000
  60. gwFlagErr                        EQU        $80000000
  61. ; typedef unsigned long                 GWorldFlags
  62.  
  63. ;  Type definition of a GWorldPtr 
  64. ; typedef CGrafPtr                         GWorldPtr
  65.  
  66. ;
  67. ; pascal QDErr NewGWorld(GWorldPtr *offscreenGWorld, short PixelDepth, const Rect *boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags)
  68. ;
  69.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  70.         Macro
  71.         _NewGWorld
  72.             move.l              #$00160000,D0
  73.             dc.w                $AB1D
  74.         EndM
  75.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  76.         IMPORT_CFM_FUNCTION NewGWorld
  77.     ENDIF
  78.  
  79.     IF ¬ TARGET_OS_MAC THEN
  80. ;  Quicktime 3.0 
  81.     IF TARGET_OS_WIN32 THEN
  82. ;  gdevice attribute bits
  83.  
  84. deviceIsIndirect                EQU        $00000001
  85. deviceNeedsLock                    EQU        $00000002
  86. deviceIsStatic                    EQU        $00000004
  87. deviceIsExternalBuffer            EQU        $00000008
  88. deviceIsDDSurface                EQU        $00000010
  89. deviceIsDCISurface                EQU        $00000020
  90. deviceIsGDISurface                EQU        $00000040
  91. deviceIsAScreen                    EQU        $00000080
  92. deviceIsOverlaySurface            EQU        $00000100
  93. ;
  94. ; pascal void *GetGDeviceSurface(GDHandle gdh)
  95. ;
  96.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  97.         IMPORT_CFM_FUNCTION GetGDeviceSurface
  98.     ENDIF
  99.  
  100. ;
  101. ; pascal unsigned long GetGDeviceAttributes(GDHandle gdh)
  102. ;
  103.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  104.         IMPORT_CFM_FUNCTION GetGDeviceAttributes
  105.     ENDIF
  106.  
  107. ;  to allocate non-mac-rgb GWorlds use QTNewGWorld (ImageCompression.h) 
  108. ;
  109. ; pascal QDErr NewGWorldFromHBITMAP(GWorldPtr *offscreenGWorld, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags, void *newHBITMAP, void *newHDC)
  110. ;
  111.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  112.         IMPORT_CFM_FUNCTION NewGWorldFromHBITMAP
  113.     ENDIF
  114.  
  115.     ENDIF    ; TARGET_OS_WIN32
  116. ;
  117. ; pascal QDErr NewGWorldFromPtr(GWorldPtr *offscreenGWorld, unsigned long PixelFormat, const Rect *boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags, Ptr newBuffer, long rowBytes)
  118. ;
  119.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  120.         IMPORT_CFM_FUNCTION NewGWorldFromPtr
  121.     ENDIF
  122.  
  123.     ENDIF
  124. ;
  125. ; pascal Boolean LockPixels(PixMapHandle pm)
  126. ;
  127.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  128.         Macro
  129.         _LockPixels
  130.             move.l              #$00040001,D0
  131.             dc.w                $AB1D
  132.         EndM
  133.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  134.         IMPORT_CFM_FUNCTION LockPixels
  135.     ENDIF
  136.  
  137. ;
  138. ; pascal void UnlockPixels(PixMapHandle pm)
  139. ;
  140.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  141.         Macro
  142.         _UnlockPixels
  143.             move.l              #$00040002,D0
  144.             dc.w                $AB1D
  145.         EndM
  146.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  147.         IMPORT_CFM_FUNCTION UnlockPixels
  148.     ENDIF
  149.  
  150. ;
  151. ; pascal GWorldFlags UpdateGWorld(GWorldPtr *offscreenGWorld, short pixelDepth, const Rect *boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags)
  152. ;
  153.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  154.         Macro
  155.         _UpdateGWorld
  156.             move.l              #$00160003,D0
  157.             dc.w                $AB1D
  158.         EndM
  159.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  160.         IMPORT_CFM_FUNCTION UpdateGWorld
  161.     ENDIF
  162.  
  163. ;
  164. ; pascal void DisposeGWorld(GWorldPtr offscreenGWorld)
  165. ;
  166.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  167.         Macro
  168.         _DisposeGWorld
  169.             move.l              #$00040004,D0
  170.             dc.w                $AB1D
  171.         EndM
  172.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  173.         IMPORT_CFM_FUNCTION DisposeGWorld
  174.     ENDIF
  175.  
  176. ;
  177. ; pascal void GetGWorld(CGrafPtr *port, GDHandle *gdh)
  178. ;
  179.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  180.         Macro
  181.         _GetGWorld
  182.             move.l              #$00080005,D0
  183.             dc.w                $AB1D
  184.         EndM
  185.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  186.         IMPORT_CFM_FUNCTION GetGWorld
  187.     ENDIF
  188.  
  189. ;
  190. ; pascal void SetGWorld(CGrafPtr port, GDHandle gdh)
  191. ;
  192.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  193.         Macro
  194.         _SetGWorld
  195.             move.l              #$00080006,D0
  196.             dc.w                $AB1D
  197.         EndM
  198.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  199.         IMPORT_CFM_FUNCTION SetGWorld
  200.     ENDIF
  201.  
  202. ;
  203. ; pascal void CTabChanged(CTabHandle ctab)
  204. ;
  205.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  206.         Macro
  207.         _CTabChanged
  208.             move.l              #$00040007,D0
  209.             dc.w                $AB1D
  210.         EndM
  211.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  212.         IMPORT_CFM_FUNCTION CTabChanged
  213.     ENDIF
  214.  
  215. ;
  216. ; pascal void PixPatChanged(PixPatHandle ppat)
  217. ;
  218.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  219.         Macro
  220.         _PixPatChanged
  221.             move.l              #$00040008,D0
  222.             dc.w                $AB1D
  223.         EndM
  224.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  225.         IMPORT_CFM_FUNCTION PixPatChanged
  226.     ENDIF
  227.  
  228. ;
  229. ; pascal void PortChanged(GrafPtr port)
  230. ;
  231.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  232.         Macro
  233.         _PortChanged
  234.             move.l              #$00040009,D0
  235.             dc.w                $AB1D
  236.         EndM
  237.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  238.         IMPORT_CFM_FUNCTION PortChanged
  239.     ENDIF
  240.  
  241. ;
  242. ; pascal void GDeviceChanged(GDHandle gdh)
  243. ;
  244.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  245.         Macro
  246.         _GDeviceChanged
  247.             move.l              #$0004000A,D0
  248.             dc.w                $AB1D
  249.         EndM
  250.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  251.         IMPORT_CFM_FUNCTION GDeviceChanged
  252.     ENDIF
  253.  
  254. ;
  255. ; pascal void AllowPurgePixels(PixMapHandle pm)
  256. ;
  257.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  258.         Macro
  259.         _AllowPurgePixels
  260.             move.l              #$0004000B,D0
  261.             dc.w                $AB1D
  262.         EndM
  263.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  264.         IMPORT_CFM_FUNCTION AllowPurgePixels
  265.     ENDIF
  266.  
  267. ;
  268. ; pascal void NoPurgePixels(PixMapHandle pm)
  269. ;
  270.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  271.         Macro
  272.         _NoPurgePixels
  273.             move.l              #$0004000C,D0
  274.             dc.w                $AB1D
  275.         EndM
  276.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  277.         IMPORT_CFM_FUNCTION NoPurgePixels
  278.     ENDIF
  279.  
  280. ;
  281. ; pascal GWorldFlags GetPixelsState(PixMapHandle pm)
  282. ;
  283.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  284.         Macro
  285.         _GetPixelsState
  286.             move.l              #$0004000D,D0
  287.             dc.w                $AB1D
  288.         EndM
  289.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  290.         IMPORT_CFM_FUNCTION GetPixelsState
  291.     ENDIF
  292.  
  293. ;
  294. ; pascal void SetPixelsState(PixMapHandle pm, GWorldFlags state)
  295. ;
  296.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  297.         Macro
  298.         _SetPixelsState
  299.             move.l              #$0008000E,D0
  300.             dc.w                $AB1D
  301.         EndM
  302.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  303.         IMPORT_CFM_FUNCTION SetPixelsState
  304.     ENDIF
  305.  
  306. ;
  307. ; pascal Ptr GetPixBaseAddr(PixMapHandle pm)
  308. ;
  309.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  310.         Macro
  311.         _GetPixBaseAddr
  312.             move.l              #$0004000F,D0
  313.             dc.w                $AB1D
  314.         EndM
  315.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  316.         IMPORT_CFM_FUNCTION GetPixBaseAddr
  317.     ENDIF
  318.  
  319. ;
  320. ; pascal QDErr NewScreenBuffer(const Rect *globalRect, Boolean purgeable, GDHandle *gdh, PixMapHandle *offscreenPixMap)
  321. ;
  322.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  323.         Macro
  324.         _NewScreenBuffer
  325.             move.l              #$000E0010,D0
  326.             dc.w                $AB1D
  327.         EndM
  328.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  329.         IMPORT_CFM_FUNCTION NewScreenBuffer
  330.     ENDIF
  331.  
  332. ;
  333. ; pascal void DisposeScreenBuffer(PixMapHandle offscreenPixMap)
  334. ;
  335.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  336.         Macro
  337.         _DisposeScreenBuffer
  338.             move.l              #$00040011,D0
  339.             dc.w                $AB1D
  340.         EndM
  341.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  342.         IMPORT_CFM_FUNCTION DisposeScreenBuffer
  343.     ENDIF
  344.  
  345. ;
  346. ; pascal GDHandle GetGWorldDevice(GWorldPtr offscreenGWorld)
  347. ;
  348.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  349.         Macro
  350.         _GetGWorldDevice
  351.             move.l              #$00040012,D0
  352.             dc.w                $AB1D
  353.         EndM
  354.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  355.         IMPORT_CFM_FUNCTION GetGWorldDevice
  356.     ENDIF
  357.  
  358. ;
  359. ; pascal Boolean QDDone(GrafPtr port)
  360. ;
  361.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  362.         Macro
  363.         _QDDone
  364.             move.l              #$00040013,D0
  365.             dc.w                $AB1D
  366.         EndM
  367.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  368.         IMPORT_CFM_FUNCTION QDDone
  369.     ENDIF
  370.  
  371. ;
  372. ; pascal long OffscreenVersion(void )
  373. ;
  374.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  375.         Macro
  376.         _OffscreenVersion
  377.             moveq               #20,D0
  378.             dc.w                $AB1D
  379.         EndM
  380.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  381.         IMPORT_CFM_FUNCTION OffscreenVersion
  382.     ENDIF
  383.  
  384. ;
  385. ; pascal QDErr NewTempScreenBuffer(const Rect *globalRect, Boolean purgeable, GDHandle *gdh, PixMapHandle *offscreenPixMap)
  386. ;
  387.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  388.         Macro
  389.         _NewTempScreenBuffer
  390.             move.l              #$000E0015,D0
  391.             dc.w                $AB1D
  392.         EndM
  393.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  394.         IMPORT_CFM_FUNCTION NewTempScreenBuffer
  395.     ENDIF
  396.  
  397. ;
  398. ; pascal Boolean PixMap32Bit(PixMapHandle pmHandle)
  399. ;
  400.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  401.         Macro
  402.         _PixMap32Bit
  403.             move.l              #$00040016,D0
  404.             dc.w                $AB1D
  405.         EndM
  406.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  407.         IMPORT_CFM_FUNCTION PixMap32Bit
  408.     ENDIF
  409.  
  410. ;
  411. ; pascal PixMapHandle GetGWorldPixMap(GWorldPtr offscreenGWorld)
  412. ;
  413.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  414.         Macro
  415.         _GetGWorldPixMap
  416.             move.l              #$00040017,D0
  417.             dc.w                $AB1D
  418.         EndM
  419.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  420.         IMPORT_CFM_FUNCTION GetGWorldPixMap
  421.     ENDIF
  422.  
  423.  
  424.     ENDIF ; __QDOFFSCREEN__ 
  425.  
  426.